package com.yiran.servlet;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.yiran.dao.AdminBean;
import com.yiran.dao.SortBean;
import com.yiran.model.AdminClass;
import com.yiran.model.SortClass;

public class SortAddServlet extends HttpServlet {

	public void doGet(HttpServletRequest request, HttpServletResponse response)
	throws ServletException, IOException {

		response.setContentType("text/html;charset=GBK");
		request.setCharacterEncoding("GBK");

		String name = request.getParameter("sortName");
		
		SortClass sort = new SortClass();
		sort.setName(name);
		
		SortBean bean = new SortBean();
		bean.setStyleInfo(sort);
		try {
			bean.addSortInfo();
		} catch (Exception e1) {
			e1.printStackTrace();
		}
		request.getRequestDispatcher("/admin/success.jsp").forward(request, response);
	}

	public void doPost(HttpServletRequest request, HttpServletResponse response)
	throws ServletException, IOException {

		doGet(request, response);
	}
}
